package app

import (
	"github.com/spf13/viper"
	"k8s-admin/global"
	"k8s-admin/router"
)

func init() {
	global.InitConfig()
	global.InitLog()
	global.InitMysql()
	global.InitMysqlTables()
	//global.InitCasbinEnforcer()
	global.InitK8sClientCache()
	global.ClusterAllStatus()

}

func Start() {
	//go func() {
	//	_ = utils.InitAllClient()
	//}()
	route := router.InitRoute()
	route.Run(viper.GetString("Service.local") + ":" + viper.GetString("Service.port"))
}
